import request from '@/utils/request'

let baseMapping = "/course_service/course/";

export default {

  //根据id查询课程
  getCourseInfoById(id) {
    return request({
      url: baseMapping + `getCourseInfoById/${id}`,
      method: 'get'
    })
  },

  //分页查询课程
  pageQueryCourse(current, limit, course) {
    return request({
      url: baseMapping + `getCourse/${current}/${limit}`,
      method: 'post',
      data: course
    })
  },

  //添加课程
  addCourse(course) {
    return request({
      url: baseMapping + `addCourse`,
      method: 'post',
      data: course
    })
  },

  //修改课程
  updateCourse(course) {
    return request({
      url: baseMapping + `updateCourse`,
      method: 'post',
      data: course
    })
  },

  //删除课程
  deleteCourse(id) {
    return request({
      url: baseMapping + `deleteCourse/${id}`,
      method: 'get'
    })
  }
}
